/*
 * Copyright(c) 2020-2100 万达信息股份有限公司 版权所有
 * WONDERS INFORMATION CO., LTD. ALL RIGHTS RESERVED.
 */

package com.wondersgroup.drools.chapter25;

import com.wondersgroup.drools.BaseTest;
import org.junit.Test;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: huym
 * @date: 2021/1/4
 */
public class MapTest extends BaseTest {

    @Test
    public void test(){
        KieSession kieSession = this.getKieSessionBySessionName("map-rules");

        Map<String,Object> map = new HashMap<>();
        map.put("E00001","极简型架构");
        map.put("E00002",2);

        FactHandle handle = kieSession.insert(map);
        int i = kieSession.fireAllRules();
        System.out.println(i);
        System.out.println(map);
        kieSession.dispose();
    }

}